Program Templates: Expression Templates Applied to Program Evaluation

نویسنده

  • Francis Maes
چکیده

The C++ language provides a two-layer execution model: static execution of meta-programs and dynamic execution of resulting programs. The Expression Templates technique takes advantage of this dual execution model through the construction of C++ types expressing simple arithmetic formulas. Our intent is to extend this technique to a whole programming language. The Tiger language is a small, imperative language with types, variables, arrays, records, flow control structures and nested functions. The first step is to show how to express a Tiger program as a C++ type. The second step concerns operational analysis which is done through the use of meta-programs. Finally an implementation of our Tiger evaluator is proposed. Our technique goes much deeper than the Expression Templates one. It shows how the generative power of C++ meta-programming can be used in order to compile abstract syntax trees of a fully featured programming language.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Just When You Thought Your Little Language Was Safe: "Expression Templates" in Java

Template techniques in C allow a modest degree of gen erative programming creating specialized code for specialized problems This use of templates has been controversial indeed one of the oft cited reasons for migrating to Java is that it provides a simpler language free of complexities such as templates The essence of generative program ming in C is not templates the language feature but rathe...

متن کامل

\expression Templates" in Java

Template techniques in C++ allow a modest degree of gen-erative programming: creating specialized code for specialized problems. This use of templates has been controversial; indeed, one of the oft-cited reasons for migrating to Java is that it provides a simpler language, free of complexities such as templates. The essence of generative programming in C++ is not templates { the language featur...

متن کامل

A Term Rewriting Approach to Program Transformation by Templates

Huet and Lang (1978) presented a framework of automated program transformation based on lambda calculus in which programs are transformed according to a given program transformation template. They introduced a second-order matching algorithm of simply-typed lambda calculus to verify whether the input program matches the template. They also showed how to validate the correctness of the program t...

متن کامل

Design and Implementation of Task Management Lifecycle Concepts based on Process Mining

In a globalized world, knowledge work and especially Knowledge-intensive Business Processes (KiBPs) become increasingly important in highly developed countries. As a consequence, knowledge workers increasingly require an appropriate system support. Due to the more complex nature and the different characteristics of KiBPs, the Business Process Management (BPM) approach established to support tra...

متن کامل

Automatic Construction of Program Transformation Templates

Program transformation by templates (Huet and Lang, 1978) is a technique to improve the efficiency of programs. In this technique, programs are transformed according to a given program transformation template. To enhance the variety of program transformation, it is important to introduce new transformation templates. Up to our knowledge, however, few works discuss about the construction of tran...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003